import { request } from './request';
import { paramsToQuery } from '@/utils';

// 数据概览
export const fetchContentOverview = (params: any) => {
  const query = paramsToQuery(params);
  return request.get(`/da/statistics/content/content_overview${query}`);
};

// 情感占比
export const fetchSentimentRatio = (params: any) => {
  const query = paramsToQuery(params);
  return request.get(`/da/statistics/sentiment/sentiment_ratio${query}`);
};

// 方案命中关键词
export const fetchTopMatchedKeywords = (params: any) => {
  const query = paramsToQuery(params);
  return request.get(`/da/statistics/keyword/top_matched_keywords${query}`);
};

// 情感走势（敏感/非敏感）
export const fetchSentimentTrand = (params: any) => {
  const query = paramsToQuery(params);
  return request.get(`/da/statistics/sentiment/sentiment_trand${query}`);
};

// 热度排名
export const fetchContentTop = (params: any) => {
  const query = paramsToQuery(params);
  return request.get(`/da/statistics/content/top${query}`);
};

// 高频词分布统计
export const fetchKeywordCloud = (params: any) => {
  const query = paramsToQuery(params);
  return request.get(`/da/statistics/keyword/cloud${query}`);
};

// 高频词指数
export const fetchKeywordIndexTrend = (params: any) => {
  const query = paramsToQuery(params);
  return request.get(`/da/statistics/keyword/keyword_index_trend${query}`);
};

// 平台活跃度
export const fetchPlatformActivity = (params: any) => {
  const query = paramsToQuery(params);
  return request.get(`/da/statistics/content/platform_activity${query}`);
};

// 最新内容
export const fetchContentLatest = (params: any) => {
  const query = paramsToQuery(params);
  return request.get(`/da/statistics/content/latest${query}`);
};

// 获取所有方案
export const fetchGetAllPlan = () => {
  return request.get(`/system/plan/all`);
};
